use shuwencdp;

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

DROP TABLE IF EXISTS `sys_config`;
CREATE TABLE `sys_config` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `param_key` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'key',
  `param_value` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'value',
  `status` tinyint DEFAULT '1' COMMENT '状态   0：隐藏   1：显示',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `param_key` (`param_key`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='系统配置信息表';

-- ----------------------------
-- Records of sys_config
-- ----------------------------
BEGIN;
INSERT INTO `sys_config` (`id`, `param_key`, `param_value`, `status`, `remark`) VALUES (1, 'CLOUD_STORAGE_CONFIG_KEY', '{\"aliyunAccessKeyId\":\"\",\"aliyunAccessKeySecret\":\"\",\"aliyunBucketName\":\"\",\"aliyunDomain\":\"\",\"aliyunEndPoint\":\"\",\"aliyunPrefix\":\"\",\"qcloudBucketName\":\"\",\"qcloudDomain\":\"\",\"qcloudPrefix\":\"\",\"qcloudSecretId\":\"\",\"qcloudSecretKey\":\"\",\"qiniuAccessKey\":\"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ\",\"qiniuBucketName\":\"ios-app\",\"qiniuDomain\":\"http://7xqbwh.dl1.z0.glb.clouddn.com\",\"qiniuPrefix\":\"upload\",\"qiniuSecretKey\":\"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV\",\"type\":1}', 0, '云存储配置信息');
COMMIT;

-- ----------------------------
-- Table structure for sys_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_log`;
CREATE TABLE `sys_log` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户名',
  `operation` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户操作',
  `method` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '请求方法',
  `params` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '请求参数',
  `time` bigint NOT NULL COMMENT '执行时长(毫秒)',
  `ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'IP地址',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=82 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='系统日志';


-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
  `menu_id` bigint NOT NULL AUTO_INCREMENT,
  `parent_id` bigint DEFAULT NULL COMMENT '父菜单ID，一级菜单为0',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '菜单名称',
  `url` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '菜单URL',
  `perms` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '授权(多个用逗号分隔，如：user:list,user:create)',
  `type` int DEFAULT NULL COMMENT '类型   0：目录   1：菜单   2：按钮',
  `icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '菜单图标',
  `order_num` int DEFAULT NULL COMMENT '排序',
  `disabled` tinyint(1) DEFAULT NULL COMMENT '是否启用 0:启用 1:禁用',
  `long_id` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '上级所有id',
  PRIMARY KEY (`menu_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='菜单管理';

-- ----------------------------
-- Records of sys_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `disabled`, `long_id`) VALUES (1, 0, '数据大盘', '1', NULL, 0, 'isComputer', 1, 0, '0,1');
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `disabled`, `long_id`) VALUES (2, 1, '公共概览', '/overView/1', 'analysis:common:overview', 1, NULL, 2, 0, '0,1,2');
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `disabled`, `long_id`) VALUES (3, 1, '我的概览', '/overview/home', 'analysis:overview', 1, NULL, 3, 0, '0,1,3');
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `disabled`, `long_id`) VALUES (4, 0, '数据分析', '4', NULL, 0, 'isChart', 4, 0, '0,4');
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `disabled`, `long_id`) VALUES (5, 4, '事件分析', '/analysis/event', 'analysis:event:analysis', 1, NULL, 5, 0, '0,4,5');
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `disabled`, `long_id`) VALUES (6, 4, '自定义查询', '/analysis/customQueries', 'analysis:adhoc:analysis', 1, NULL, 6, 0, '0,4,6');
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `disabled`, `long_id`) VALUES (7, 0, '数据管理', '7', NULL, 0, 'isNav', 7, 0, '0,7');
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `disabled`, `long_id`) VALUES (8, 7, '事件管理', '/data/eventManagement', 'analysis:metadata:event', 1, NULL, 8, 0, '0,7,8');
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `disabled`, `long_id`) VALUES (9, 7, '属性管理', '/data/propertyManagement', 'analysis:metadata:property', 1, NULL, 9, 0, '0,7,9');
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `role_id` bigint NOT NULL AUTO_INCREMENT,
  `role_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '角色名称',
  `remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
  `create_user_id` bigint DEFAULT NULL COMMENT '创建者ID',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除',
  PRIMARY KEY (`role_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色';

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` (`role_id`, `role_name`, `remark`, `create_user_id`, `create_time`, `del_flag`) VALUES (1, '管理员', NULL, 1, '2022-06-29 14:17:33', 0);


-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `role_id` bigint DEFAULT NULL COMMENT '角色ID',
  `menu_id` bigint DEFAULT NULL COMMENT '菜单ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色与菜单对应关系';

-- ----------------------------
-- Records of sys_role_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (13, 5, 2);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (14, 5, 3);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (15, 5, 1);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (16, 5, 4);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (17, 5, 5);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (18, 5, 6);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (19, 5, 7);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (21, 6, 3);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (24, 7, 2);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (26, 8, 2);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (29, 9, 2);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (30, 10, 2);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (31, 11, 3);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (32, 3, 2);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (33, 3, 3);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (34, 3, 1);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (42, 17, 2);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (43, 2, 2);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (44, 4, 2);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (45, 4, 3);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (46, 4, 1);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`) VALUES (47, 4, 5);
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `user_id` bigint NOT NULL AUTO_INCREMENT,
  `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名',
  `password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '密码',
  `salt` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '盐',
  `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '邮箱',
  `mobile` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '手机号',
  `status` tinyint DEFAULT NULL COMMENT '状态  0：禁用   1：正常',
  `create_user_id` bigint DEFAULT NULL COMMENT '创建者ID',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除',
  PRIMARY KEY (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='系统用户';

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` (`user_id`, `username`, `password`, `salt`, `email`, `mobile`, `status`, `create_user_id`, `create_time`, `del_flag`) VALUES (1, 'admin', '9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d', 'YzcmCZNvbXocrsz9dm8e', 'root@fibo.cn', '175212345676', 1, 1, '2016-11-11 11:11:11', 0);


-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint DEFAULT NULL COMMENT '用户ID',
  `role_id` bigint DEFAULT NULL COMMENT '角色ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户与角色对应关系';

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (6, 5, 1);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (7, 6, 1);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (12, 9, 1);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (13, 9, 9);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (16, 11, 1);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (17, 11, 9);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (18, 2, 1);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (20, 7, 1);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (21, 7, 9);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (22, 8, 1);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (23, 8, 9);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (27, 10, 1);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (29, 4, 2);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (30, 12, 2);
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`) VALUES (34, 13, 2);
COMMIT;

-- ----------------------------
-- Table structure for t_analysis_metadata_customsql_data
-- ----------------------------
DROP TABLE IF EXISTS `t_analysis_metadata_customsql_data`;
CREATE TABLE `t_analysis_metadata_customsql_data` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `query_sql` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'sql语句',
  `params` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '参数设置',
  `model_id` bigint DEFAULT NULL COMMENT '分析模型ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='属性定义表';


-- ----------------------------
-- Table structure for t_analysis_metadata_event_data
-- ----------------------------
DROP TABLE IF EXISTS `t_analysis_metadata_event_data`;
CREATE TABLE `t_analysis_metadata_event_data` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name_cn` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '事件中文',
  `name_en` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '事件英文名',
  `group_id` bigint DEFAULT NULL COMMENT '分组ID',
  `status` tinyint(1) DEFAULT NULL,
  `remarks` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `create_user_id` bigint DEFAULT NULL,
  `del_flag` tinyint(1) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_user_id` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `sort` int DEFAULT NULL COMMENT '排序值',
  `is_virtual` tinyint(1) DEFAULT NULL COMMENT '是否是虚拟事件',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='事件定义表';

-- ----------------------------
-- Records of t_analysis_metadata_event_data
-- ----------------------------
BEGIN;
INSERT INTO `t_analysis_metadata_event_data` (`id`,`name_cn`,`name_en`,`group_id`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`sort`,`is_virtual`) VALUES (1,'全站流量','visit_xn',1,0,NULL,1,0,'2022-05-17 02:25:01',1,'2022-05-17 02:25:01',1,1);
INSERT INTO `t_analysis_metadata_event_data` (`id`,`name_cn`,`name_en`,`group_id`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`sort`,`is_virtual`) VALUES (2,'注册结果','RegisterResult',2,0,NULL,1,0,'2022-05-17 02:25:01',1,'2022-06-30 17:28:17',2,0);
INSERT INTO `t_analysis_metadata_event_data` (`id`,`name_cn`,`name_en`,`group_id`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`sort`,`is_virtual`) VALUES (8,'小程序页面浏览','$MPViewScreen',1,0,NULL,1,0,'2022-05-17 02:25:01',1,'2022-05-17 02:25:01',8,0);
INSERT INTO `t_analysis_metadata_event_data` (`id`,`name_cn`,`name_en`,`group_id`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`sort`,`is_virtual`) VALUES (10,'全站新用户访问','new_visitor_xn',1,0,NULL,1,0,'2022-05-17 02:25:01',1,'2022-05-17 02:25:01',10,1);
INSERT INTO `t_analysis_metadata_event_data` (`id`,`name_cn`,`name_en`,`group_id`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`sort`,`is_virtual`) VALUES (12,'小程序启动','$MPLaunch',1,0,NULL,1,0,'2022-05-17 02:25:01',1,'2022-05-17 02:25:01',12,0);
INSERT INTO `t_analysis_metadata_event_data` (`id`,`name_cn`,`name_en`,`group_id`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`sort`,`is_virtual`) VALUES (13,'Web浏览页面','$pageview',1,0,NULL,1,0,'2022-05-17 02:25:01',1,'2023-09-02 10:15:45',13,0);
INSERT INTO `t_analysis_metadata_event_data` (`id`,`name_cn`,`name_en`,`group_id`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`sort`,`is_virtual`) VALUES (16,'小程序进入后台','$MPHide',4,0,NULL,1,0,'2022-05-17 19:29:38',1,'2022-05-17 19:29:42',16,0);
INSERT INTO `t_analysis_metadata_event_data` (`id`,`name_cn`,`name_en`,`group_id`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`sort`,`is_virtual`) VALUES (18,'登录','登录',2,0,NULL,1,0,'2022-06-02 15:59:04',1,'2022-06-02 15:59:17',18,0);
INSERT INTO `t_analysis_metadata_event_data` (`id`,`name_cn`,`name_en`,`group_id`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`sort`,`is_virtual`) VALUES (23,'提交订单详情','提交订单详情',3,0,NULL,1,0,'2022-06-28 14:59:34',1,'2022-06-28 14:59:38',6,1);
INSERT INTO `t_analysis_metadata_event_data` (`id`,`name_cn`,`name_en`,`group_id`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`sort`,`is_virtual`) VALUES (30,'订单支付','payOrder',3,0,'',1,0,'2023-09-02 10:39:20',1,'2023-09-02 10:39:20',1,0);
INSERT INTO `t_analysis_metadata_event_data` (`id`,`name_cn`,`name_en`,`group_id`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`sort`,`is_virtual`) VALUES (31,'放弃支付','cancelPay',3,0,'',1,0,'2023-09-02 10:55:22',1,'2023-09-02 10:55:22',2,0);
COMMIT;

-- ----------------------------
-- Table structure for t_analysis_metadata_event_group
-- ----------------------------
DROP TABLE IF EXISTS `t_analysis_metadata_event_group`;
CREATE TABLE `t_analysis_metadata_event_group` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '分组名称',
  `status` tinyint(1) DEFAULT NULL,
  `remarks` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `create_user_id` bigint DEFAULT NULL,
  `del_flag` tinyint(1) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_user_id` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `sort` int DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='事件分组';

-- ----------------------------
-- Records of t_analysis_metadata_event_group
-- ----------------------------
BEGIN;
INSERT INTO `t_analysis_metadata_event_group` (`id`, `name`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `sort`) VALUES (1, '访问流量', 0, NULL, 1, 0, '2022-05-14 22:48:05', 1, '2022-05-14 22:48:10', 1);
INSERT INTO `t_analysis_metadata_event_group` (`id`, `name`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `sort`) VALUES (2, '登录注册', 0, NULL, 1, 0, '2022-05-17 09:47:42', 1, '2022-05-17 09:47:46', 2);
INSERT INTO `t_analysis_metadata_event_group` (`id`, `name`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `sort`) VALUES (3, '订单交易', 0, NULL, 1, 0, '2022-05-17 09:48:03', 1, '2022-05-17 09:48:06', 3);
INSERT INTO `t_analysis_metadata_event_group` (`id`, `name`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `sort`) VALUES (4, '用户行为', 0, NULL, 1, 0, '2022-05-17 09:49:06', 1, '2022-05-17 09:49:10', 4);
COMMIT;

-- ----------------------------
-- Table structure for t_analysis_metadata_event_property_rel
-- ----------------------------
DROP TABLE IF EXISTS `t_analysis_metadata_event_property_rel`;
CREATE TABLE `t_analysis_metadata_event_property_rel` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `event_en` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '事件ID',
  `property_en` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '属性定义ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='事件属性关联关系表';

-- ----------------------------
-- Records of t_analysis_metadata_event_property_rel
-- ----------------------------
BEGIN;
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (3,'$MPLaunch','$is_first_day');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (5,'$MPHide','$event_duration');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (8,'提交订单','order_amount');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (9,'提交订单详情','commodity_quantity');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (18,'支付订单详情','$is_first_day');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (19,'支付订单详情','is_success');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (25,'订单支付','order_actual_amount');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (26,'订单支付','platform_type');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (32,'nameEn','nameEn');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (41,'mnfdslknds','order_actual_amount');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (42,'mnfdslknds','$event_duration');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (43,'mnfdslknds','platform_type');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (44,'mnfdslknds','commodity_quantity');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (45,'mnfdslknds','order_amount');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (46,'$pageview','$is_first_day');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (47,'$pageview','$lib');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (48,'payOrder','order_amount');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (49,'cancelPay','order_actual_amount');
INSERT INTO `t_analysis_metadata_event_property_rel` (`id`,`event_en`,`property_en`) VALUES (50,'cancelPay','order_amount');
COMMIT;

-- ----------------------------
-- Table structure for t_analysis_metadata_event_virtual_data
-- ----------------------------
DROP TABLE IF EXISTS `t_analysis_metadata_event_virtual_data`;
CREATE TABLE `t_analysis_metadata_event_virtual_data` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `virtual_event_en` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '虚拟事件英文名',
  `name_en` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '事件英文名',
  `where_uuid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '该属性的筛选条件',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='虚拟事件明细表';

-- ----------------------------
-- Records of t_analysis_metadata_event_virtual_data
-- ----------------------------
BEGIN;
INSERT INTO `t_analysis_metadata_event_virtual_data` (`id`, `virtual_event_en`, `name_en`, `where_uuid`) VALUES (1, 'visit_xn', '$pageview', NULL);
INSERT INTO `t_analysis_metadata_event_virtual_data` (`id`, `virtual_event_en`, `name_en`, `where_uuid`) VALUES (2, 'visit_xn', '$MPViewScreen', NULL);
INSERT INTO `t_analysis_metadata_event_virtual_data` (`id`, `virtual_event_en`, `name_en`, `where_uuid`) VALUES (4, 'new_visitor_xn', '$MPViewScreen', '537d0494568c68e80c8979646f2de33');
INSERT INTO `t_analysis_metadata_event_virtual_data` (`id`, `virtual_event_en`, `name_en`, `where_uuid`) VALUES (5, 'new_visitor_xn', '$pageview', '4f835cf95e6f169732335a6b93f0afea');
COMMIT;

-- ----------------------------
-- Table structure for t_analysis_metadata_property_data
-- ----------------------------
DROP TABLE IF EXISTS `t_analysis_metadata_property_data`;
CREATE TABLE `t_analysis_metadata_property_data` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name_cn` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '属性中文名',
  `name_en` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '属性英文名',
  `field_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '属性类型',
  `status` tinyint(1) DEFAULT NULL,
  `remarks` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `create_user_id` bigint DEFAULT NULL,
  `del_flag` tinyint(1) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_user_id` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `is_group_view` tinyint(1) DEFAULT NULL COMMENT '是否支持按...查看',
  `sort` int DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='属性定义表';

-- ----------------------------
-- Records of t_analysis_metadata_property_data
-- ----------------------------
BEGIN;
INSERT INTO `t_analysis_metadata_property_data` (`id`, `name_cn`, `name_en`, `field_type`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `is_group_view`, `sort`) VALUES (1, '是否首日访问', '$is_first_day', 'bool', 0, '01', 1, 0, '2022-05-15 12:47:58', 1, '2022-07-04 10:13:18', 1, NULL);
INSERT INTO `t_analysis_metadata_property_data` (`id`, `name_cn`, `name_en`, `field_type`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `is_group_view`, `sort`) VALUES (2, '是否成功', 'is_success', 'bool', 0, NULL, 1, 0, '2022-05-17 15:22:53', 1, '2022-05-17 15:22:57', 1, NULL);
INSERT INTO `t_analysis_metadata_property_data` (`id`, `name_cn`, `name_en`, `field_type`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `is_group_view`, `sort`) VALUES (3, '订单实付金额', 'order_actual_amount', 'number', 0, NULL, 1, 0, '2022-05-17 15:27:27', 1, '2022-05-17 15:27:30', 0, NULL);
INSERT INTO `t_analysis_metadata_property_data` (`id`, `name_cn`, `name_en`, `field_type`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `is_group_view`, `sort`) VALUES (4, '停留时长', '$event_duration', 'number', 0, NULL, 1, 0, '2022-05-17 15:35:46', 1, '2022-05-17 15:35:50', 0, NULL);
INSERT INTO `t_analysis_metadata_property_data` (`id`, `name_cn`, `name_en`, `field_type`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `is_group_view`, `sort`) VALUES (5, '端口', 'platform_type', 'string', 0, '111', 1, 0, '2022-05-17 17:37:51', 1, '2022-07-04 18:58:48', 1, 10);
INSERT INTO `t_analysis_metadata_property_data` (`id`, `name_cn`, `name_en`, `field_type`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `is_group_view`, `sort`) VALUES (6, '省份', '$province', 'string', 0, NULL, 1, 0, '2022-05-20 14:53:14', 1, '2022-05-20 14:53:17', 1, NULL);
INSERT INTO `t_analysis_metadata_property_data` (`id`, `name_cn`, `name_en`, `field_type`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `is_group_view`, `sort`) VALUES (7, '渠道编号', 'channel', 'string', 0, NULL, 1, 0, '2022-05-27 10:43:07', 1, '2022-05-27 10:43:11', 1, NULL);
INSERT INTO `t_analysis_metadata_property_data` (`id`, `name_cn`, `name_en`, `field_type`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `is_group_view`, `sort`) VALUES (8, '商品名称', 'commodity_name', 'string', 0, NULL, 1, 0, '2022-06-28 14:47:05', 1, '2022-06-28 14:47:08', 1, NULL);
INSERT INTO `t_analysis_metadata_property_data` (`id`, `name_cn`, `name_en`, `field_type`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `is_group_view`, `sort`) VALUES (9, '商品数量', 'commodity_quantity', 'number', 0, NULL, 1, 0, '2022-06-28 14:55:11', 1, '2022-06-28 14:55:14', 0, NULL);
INSERT INTO `t_analysis_metadata_property_data` (`id`, `name_cn`, `name_en`, `field_type`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `is_group_view`, `sort`) VALUES (10, '提交订单金额', 'order_amount', 'number', 0, NULL, 1, 0, '2022-06-28 15:08:41', 1, '2022-06-28 15:08:46', 0, NULL);
INSERT INTO `t_analysis_metadata_property_data` (`id`, `name_cn`, `name_en`, `field_type`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `is_group_view`, `sort`) VALUES (11, 'nameCn', 'nameEn', 'string', NULL, NULL, NULL, 1, NULL, 1, '2022-06-28 18:31:17', 0, NULL);
INSERT INTO `t_analysis_metadata_property_data` (`id`, `name_cn`, `name_en`, `field_type`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `is_group_view`, `sort`) VALUES (12, 'type', 'type', 'string', 0, NULL, 1, 0, '2022-06-30 18:37:00', 1, '2022-06-30 18:37:00', 0, NULL);
INSERT INTO `t_analysis_metadata_property_data` (`id`, `name_cn`, `name_en`, `field_type`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `is_group_view`, `sort`) VALUES (15, '操作系统', '$os', 'string', 0, '打算的', 1, 1, '2022-07-01 14:25:55', 1, '2022-07-01 14:25:55', 0, 2);
INSERT INTO `t_analysis_metadata_property_data` (`id`, `name_cn`, `name_en`, `field_type`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `is_group_view`, `sort`) VALUES (16, '设备型号', '$model', 'string', 0, '000', 1, 1, '2022-07-01 14:39:11', 1, '2022-07-01 14:39:11', 1, 1);
INSERT INTO `t_analysis_metadata_property_data` (`id`, `name_cn`, `name_en`, `field_type`, `status`, `remarks`, `create_user_id`, `del_flag`, `create_time`, `update_user_id`, `update_time`, `is_group_view`, `sort`) VALUES (17, '数据包类型', '$lib', 'string', 0, '', 1, 0, '2023-09-02 10:14:42', 1, '2023-09-02 10:14:42', 1, 1);
COMMIT;

-- ----------------------------
-- Table structure for t_analysis_model_data
-- ----------------------------
DROP TABLE IF EXISTS `t_analysis_model_data`;
CREATE TABLE `t_analysis_model_data` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `type` tinyint DEFAULT NULL COMMENT '分型模型类型 0:事件 1:漏斗 2:留存 3:自定义',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '模型名称',
  `time_granularity` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '时间粒度day、week、month、hour、minute  ',
  `time_value` int DEFAULT NULL COMMENT '时间值',
  `chart_type` tinyint DEFAULT NULL COMMENT '0:线图 1:柱状图 2:环图 3:堆积图 4:表格 5:数值 仅事件分析存在 6:漏斗分析',
  `where_uuid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '全局筛选uuid',
  `is_avg` tinyint(1) DEFAULT NULL COMMENT '是否同时显示均值',
  `is_sum` tinyint(1) DEFAULT NULL COMMENT '是否同时合计',
  `is_year_to_year` tinyint(1) DEFAULT NULL COMMENT '是否同时显示同环比',
  `window_size` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '窗口尺寸',
  `status` tinyint(1) DEFAULT NULL,
  `remarks` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `create_user_id` bigint DEFAULT NULL,
  `del_flag` tinyint(1) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_user_id` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `overview_id` bigint DEFAULT NULL COMMENT '归属概览ID',
  `calc_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '按...计算,users按人数、total按次数',
  `sort` int DEFAULT NULL COMMENT '所在概览的序号',
  `start_time` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '开始时间',
  `end_time` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '结束时间',
  `funnel_id` bigint DEFAULT NULL COMMENT '漏斗ID',
  `relation` varchar(5) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '全局筛选逻辑关联AND、OR',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=208 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of t_analysis_model_data
-- ----------------------------
BEGIN;
INSERT INTO `t_analysis_model_data` (`id`,`type`,`name`,`time_granularity`,`time_value`,`chart_type`,`where_uuid`,`is_avg`,`is_sum`,`is_year_to_year`,`window_size`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`overview_id`,`calc_type`,`sort`,`start_time`,`end_time`,`funnel_id`,`relation`) VALUES (73,0,'全站流量','day',NULL,5,NULL,1,1,1,'mini',0,NULL,1,0,'2022-06-13 18:11:35',1,'2023-09-01 18:49:00',1,NULL,1,'2023-08-28 00:00:00.000','2023-09-01 23:59:59.999',NULL,NULL);
INSERT INTO `t_analysis_model_data` (`id`,`type`,`name`,`time_granularity`,`time_value`,`chart_type`,`where_uuid`,`is_avg`,`is_sum`,`is_year_to_year`,`window_size`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`overview_id`,`calc_type`,`sort`,`start_time`,`end_time`,`funnel_id`,`relation`) VALUES (74,0,'全站日活','day',NULL,5,NULL,1,1,1,'mini',0,NULL,1,0,'2022-06-13 18:12:16',1,'2023-09-01 18:49:22',1,NULL,2,'2023-08-28 00:00:00.000','2023-09-01 23:59:59.999',NULL,NULL);
INSERT INTO `t_analysis_model_data` (`id`,`type`,`name`,`time_granularity`,`time_value`,`chart_type`,`where_uuid`,`is_avg`,`is_sum`,`is_year_to_year`,`window_size`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`overview_id`,`calc_type`,`sort`,`start_time`,`end_time`,`funnel_id`,`relation`) VALUES (75,0,'登录用户数','day',NULL,5,NULL,1,1,1,'mini',0,NULL,1,0,'2022-06-13 18:13:33',1,'2022-06-24 16:19:17',1,NULL,3,'2022-06-06 00:00:00.000','2022-06-12 23:59:59.999',NULL,NULL);
INSERT INTO `t_analysis_model_data` (`id`,`type`,`name`,`time_granularity`,`time_value`,`chart_type`,`where_uuid`,`is_avg`,`is_sum`,`is_year_to_year`,`window_size`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`overview_id`,`calc_type`,`sort`,`start_time`,`end_time`,`funnel_id`,`relation`) VALUES (76,0,'支付人数','day',NULL,5,NULL,1,1,1,'mini',0,NULL,1,0,'2022-06-13 18:14:13',1,'2023-09-02 10:44:48',1,NULL,8,'2023-08-27 00:00:00.000','2023-09-02 23:59:59.999',NULL,NULL);
INSERT INTO `t_analysis_model_data` (`id`,`type`,`name`,`time_granularity`,`time_value`,`chart_type`,`where_uuid`,`is_avg`,`is_sum`,`is_year_to_year`,`window_size`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`overview_id`,`calc_type`,`sort`,`start_time`,`end_time`,`funnel_id`,`relation`) VALUES (77,0,'订单量','day',NULL,1,NULL,1,1,0,'normal',0,NULL,1,0,'2022-06-13 18:20:28',1,'2023-09-02 10:43:13',1,NULL,6,'2023-08-27 00:00:00.000','2023-09-02 23:59:59.999',NULL,NULL);
INSERT INTO `t_analysis_model_data` (`id`,`type`,`name`,`time_granularity`,`time_value`,`chart_type`,`where_uuid`,`is_avg`,`is_sum`,`is_year_to_year`,`window_size`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`overview_id`,`calc_type`,`sort`,`start_time`,`end_time`,`funnel_id`,`relation`) VALUES (78,0,'新访问用户数','day',NULL,5,NULL,1,1,1,'mini',0,NULL,1,0,'2022-06-13 18:22:12',1,'2022-06-14 21:43:45',1,NULL,4,'2022-06-06 00:00:00.000','2022-06-12 23:59:59.999',NULL,NULL);
INSERT INTO `t_analysis_model_data` (`id`,`type`,`name`,`time_granularity`,`time_value`,`chart_type`,`where_uuid`,`is_avg`,`is_sum`,`is_year_to_year`,`window_size`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`overview_id`,`calc_type`,`sort`,`start_time`,`end_time`,`funnel_id`,`relation`) VALUES (79,0,'提交订单数','day',NULL,5,NULL,1,1,1,'mini',0,NULL,1,0,'2022-06-13 18:23:20',1,'2023-09-02 10:43:48',1,NULL,7,'2023-08-27 00:00:00.000','2023-09-02 23:59:59.999',NULL,NULL);
INSERT INTO `t_analysis_model_data` (`id`,`type`,`name`,`time_granularity`,`time_value`,`chart_type`,`where_uuid`,`is_avg`,`is_sum`,`is_year_to_year`,`window_size`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`overview_id`,`calc_type`,`sort`,`start_time`,`end_time`,`funnel_id`,`relation`) VALUES (80,0,'放弃支付用户数','day',NULL,5,NULL,1,1,1,'mini',0,NULL,1,0,'2022-06-13 18:23:43',1,'2023-09-02 10:57:40',1,NULL,9,'2023-08-27 00:00:00.000','2023-09-01 23:59:59.999',NULL,NULL);
INSERT INTO `t_analysis_model_data` (`id`,`type`,`name`,`time_granularity`,`time_value`,`chart_type`,`where_uuid`,`is_avg`,`is_sum`,`is_year_to_year`,`window_size`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`overview_id`,`calc_type`,`sort`,`start_time`,`end_time`,`funnel_id`,`relation`) VALUES (84,0,'GMV','day',NULL,0,NULL,1,1,0,'normal',0,NULL,1,0,'2022-06-14 18:08:12',1,'2023-09-02 10:42:07',1,NULL,5,'2023-08-27 00:00:00.000','2023-09-01 23:59:59.999',NULL,NULL);
INSERT INTO `t_analysis_model_data` (`id`,`type`,`name`,`time_granularity`,`time_value`,`chart_type`,`where_uuid`,`is_avg`,`is_sum`,`is_year_to_year`,`window_size`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`overview_id`,`calc_type`,`sort`,`start_time`,`end_time`,`funnel_id`,`relation`) VALUES (139,0,'客单价','day',NULL,5,NULL,1,1,1,'mini',0,NULL,1,0,'2022-06-15 14:48:59',1,'2023-09-02 10:49:12',1,NULL,10,'2023-08-27 00:00:00.000','2023-09-02 23:59:59.999',NULL,NULL);
INSERT INTO `t_analysis_model_data` (`id`,`type`,`name`,`time_granularity`,`time_value`,`chart_type`,`where_uuid`,`is_avg`,`is_sum`,`is_year_to_year`,`window_size`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`overview_id`,`calc_type`,`sort`,`start_time`,`end_time`,`funnel_id`,`relation`) VALUES (188,2,'全站留存','day',7,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,1,0,'2022-06-23 19:09:33',1,'2022-06-23 19:09:33',1,NULL,9999,'2022-06-16','2022-06-22',NULL,NULL);
INSERT INTO `t_analysis_model_data` (`id`,`type`,`name`,`time_granularity`,`time_value`,`chart_type`,`where_uuid`,`is_avg`,`is_sum`,`is_year_to_year`,`window_size`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`overview_id`,`calc_type`,`sort`,`start_time`,`end_time`,`funnel_id`,`relation`) VALUES (205,0,'全站流量','day',NULL,5,NULL,1,1,1,'mini',0,NULL,1,0,'2022-07-06 17:14:35',1,'2023-09-02 10:51:47',39,NULL,9999,'2023-08-27 00:00:00.000','2023-09-02 23:59:59.999',NULL,NULL);
INSERT INTO `t_analysis_model_data` (`id`,`type`,`name`,`time_granularity`,`time_value`,`chart_type`,`where_uuid`,`is_avg`,`is_sum`,`is_year_to_year`,`window_size`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`overview_id`,`calc_type`,`sort`,`start_time`,`end_time`,`funnel_id`,`relation`) VALUES (206,0,'提单支付','day',NULL,0,NULL,1,1,0,'normal',0,NULL,1,0,'2022-07-06 17:17:04',1,'2023-09-02 10:51:07',39,NULL,9999,'2023-08-27 00:00:00.000','2023-09-02 23:59:59.999',NULL,NULL);
INSERT INTO `t_analysis_model_data` (`id`,`type`,`name`,`time_granularity`,`time_value`,`chart_type`,`where_uuid`,`is_avg`,`is_sum`,`is_year_to_year`,`window_size`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`overview_id`,`calc_type`,`sort`,`start_time`,`end_time`,`funnel_id`,`relation`) VALUES (207,0,'日活用户','day',NULL,5,NULL,1,1,0,'mini',0,NULL,1,0,'2022-07-06 17:20:34',1,'2023-09-02 10:52:07',39,NULL,9999,'2023-08-27 00:00:00.000','2023-09-02 23:59:59.999',NULL,NULL);
COMMIT;

-- ----------------------------
-- Table structure for t_analysis_model_group
-- ----------------------------
DROP TABLE IF EXISTS `t_analysis_model_group`;
CREATE TABLE `t_analysis_model_group` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `model_id` bigint DEFAULT NULL COMMENT '模型ID',
  `property_en` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '属性英文名',
  `sort` int DEFAULT NULL COMMENT '序号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of t_analysis_model_group
-- ----------------------------
BEGIN;
INSERT INTO `t_analysis_model_group` (`id`, `model_id`, `property_en`, `sort`) VALUES (44, 73, '$lib', NULL);
COMMIT;

-- ----------------------------
-- Table structure for t_analysis_model_select
-- ----------------------------
DROP TABLE IF EXISTS `t_analysis_model_select`;
CREATE TABLE `t_analysis_model_select` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `model_id` bigint DEFAULT NULL COMMENT '分析模型ID',
  `event_en` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '事件英文名',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '名称',
  `property_en` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '属性英文名',
  `calc_type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '计算方式总次数total、用户数users、',
  `sort` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '排序值字母',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=364 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of t_analysis_model_select
-- ----------------------------
BEGIN;
INSERT INTO `t_analysis_model_select` (`id`,`model_id`,`event_en`,`name`,`property_en`,`calc_type`,`sort`) VALUES (193,78,'new_visitor_xn','全站新用户访问','','users','A');
INSERT INTO `t_analysis_model_select` (`id`,`model_id`,`event_en`,`name`,`property_en`,`calc_type`,`sort`) VALUES (341,75,'登录','登录',NULL,'users','A');
INSERT INTO `t_analysis_model_select` (`id`,`model_id`,`event_en`,`name`,`property_en`,`calc_type`,`sort`) VALUES (365,74,'visit_xn','全站流量','','users','A');
INSERT INTO `t_analysis_model_select` (`id`,`model_id`,`event_en`,`name`,`property_en`,`calc_type`,`sort`) VALUES (366,84,'payOrder','订单支付','order_amount','sum','A');
INSERT INTO `t_analysis_model_select` (`id`,`model_id`,`event_en`,`name`,`property_en`,`calc_type`,`sort`) VALUES (367,77,'payOrder','订单支付','','total','A');
INSERT INTO `t_analysis_model_select` (`id`,`model_id`,`event_en`,`name`,`property_en`,`calc_type`,`sort`) VALUES (368,79,'payOrder','订单支付','','total','A');
INSERT INTO `t_analysis_model_select` (`id`,`model_id`,`event_en`,`name`,`property_en`,`calc_type`,`sort`) VALUES (369,76,'payOrder','订单支付','','users','A');
INSERT INTO `t_analysis_model_select` (`id`,`model_id`,`event_en`,`name`,`property_en`,`calc_type`,`sort`) VALUES (373,139,'payOrder','订单支付','order_amount','max','A');
INSERT INTO `t_analysis_model_select` (`id`,`model_id`,`event_en`,`name`,`property_en`,`calc_type`,`sort`) VALUES (374,206,'payOrder','订单支付','order_amount','sum','A');
INSERT INTO `t_analysis_model_select` (`id`,`model_id`,`event_en`,`name`,`property_en`,`calc_type`,`sort`) VALUES (375,205,'visit_xn','全站流量','','total','A');
INSERT INTO `t_analysis_model_select` (`id`,`model_id`,`event_en`,`name`,`property_en`,`calc_type`,`sort`) VALUES (376,207,'visit_xn','全站流量','','users','A');
INSERT INTO `t_analysis_model_select` (`id`,`model_id`,`event_en`,`name`,`property_en`,`calc_type`,`sort`) VALUES (378,80,'cancelPay','放弃支付','','users','A');
INSERT INTO `t_analysis_model_select` (`id`,`model_id`,`event_en`,`name`,`property_en`,`calc_type`,`sort`) VALUES (379,73,'visit_xn','全站流量',NULL,'total','A');
COMMIT;

-- ----------------------------
-- Table structure for t_analysis_model_where
-- ----------------------------
DROP TABLE IF EXISTS `t_analysis_model_where`;
CREATE TABLE `t_analysis_model_where` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `uuid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '存在筛选条件的业务uuid',
  `property_en` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '事件属性英文名',
  `conditions` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '判断条件',
  `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '判断值',
  `sort` int DEFAULT NULL COMMENT '序号',
  `max_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '判断值最大值区间使用',
  `source` int DEFAULT NULL COMMENT '哪里的where条件',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of t_analysis_model_where
-- ----------------------------
BEGIN;
INSERT INTO `t_analysis_model_where` (`id`,`uuid`,`property_en`,`conditions`,`value`,`sort`,`max_value`,`source`) VALUES (43,'fd742c4d027d408ba7b752338b4ec6a6','$lib','=','js',NULL,NULL,1);
INSERT INTO `t_analysis_model_where` (`id`,`uuid`,`property_en`,`conditions`,`value`,`sort`,`max_value`,`source`) VALUES (44,'fd742c4d027d408ba7b752338b4ec6a6','is_success','true','',NULL,NULL,1);
INSERT INTO `t_analysis_model_where` (`id`,`uuid`,`property_en`,`conditions`,`value`,`sort`,`max_value`,`source`) VALUES (45,'b2a5ea9475f54eebb34cd6fb165d2548','$lib','=','iOS',NULL,NULL,1);
COMMIT;

-- ----------------------------
-- Table structure for t_analysis_overview
-- ----------------------------
DROP TABLE IF EXISTS `t_analysis_overview`;
CREATE TABLE `t_analysis_overview` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '概览名称',
  `status` tinyint(1) DEFAULT NULL,
  `remarks` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `create_user_id` bigint DEFAULT NULL,
  `del_flag` tinyint(1) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_user_id` bigint DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `overview_type` tinyint(1) DEFAULT NULL COMMENT '0 公共概览 1用户自定义概览',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='概览基础信息表';

-- ----------------------------
-- Records of t_analysis_overview
-- ----------------------------
BEGIN;
INSERT INTO `t_analysis_overview` (`id`,`name`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`overview_type`) VALUES (1,'公共概览',0,NULL,1,0,'2022-06-10 14:17:45',1,'2022-06-10 14:17:41',0);
INSERT INTO `t_analysis_overview` (`id`,`name`,`status`,`remarks`,`create_user_id`,`del_flag`,`create_time`,`update_user_id`,`update_time`,`overview_type`) VALUES (39,'自定义概览',0,NULL,1,0,'2022-07-06 17:13:02',1,'2023-09-02 10:51:24',1);
COMMIT;


SET FOREIGN_KEY_CHECKS = 1;
